import Router from 'vue-router' ;
Router.prototype.beforeEach = function (to, from, next) {
    // 判断是否登录
    if (to.path !== '/login') {
        if (localStorage.getItem('token')) {
            next()
        } else {
            next('/login')
        }
    } else {
        next()
    }
}